<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="./js/vue.js"></script>
    <title>computed计算属性完整写法</title>
</head>
<body>
    <div id="root" ></div>

    <script>
        const vm = new Vue({
            data() {
                return {
                    name:'拉克丝',
                    skills:'终极闪光'
                }
            },
            computed:{
                hero:{
                    get(){
                        return `${this.name}的终极技能是${this.skills}`
                    },
                    set(value){
                        this.name = value.name
                        this.skills = value.skills
                    }
                }
            }
        }).$mount('#root')
        console.log(vm)
        vm.hero = {name:'提莫',skills:'蘑菇雷'}
    </script>
</body>
</html>